package com.wzy.netty.nio;

import java.nio.ByteBuffer;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-20  16:13
 */
public class NIOByteBufferPutGet {
    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(64);

        buffer.putInt(33);
        buffer.putChar('好');
        buffer.putLong(323333333);

        //取出
        buffer.flip();

        System.out.println(buffer.getInt());

        System.out.println(buffer.getChar());
        System.out.println(buffer.getLong());
    }
}
